1. Field of the Invention
The present invention relates to digital computing. More particularly, the present invention relates to a method and apparatus for one or more monitors that detects and reports a status event to a database. Additionally, the present invention relates to an apparatus and method that reports multiple status events to a database through a single program. Additionally, the present invention relates to a monitor language that describes status events using a plurality of keywords.
2. Description of the Related Art
A digital design performs a finite number of logical functions or operations. For instance, a typical digital design such as a microprocessor might support four separate operations called addition (a), multiplication (m), subtraction (s), and division (d). Within each operation, different specific events may occur. For instance, addition of two negative numbers may occur, or addition of two positive numbers may occur.
A digital design will support many combinations of events where each type of specific event is called a state. In more complex designs, events may happen serially so that the number of states is increased. For instance, the operation sequence addition-multiplication-division (amd) is a different state than the operation sequence addition-multiplication-subtraction (ams). More states exist in the digital design when each a, m, s, and d operation supports various types of operands (i.e., positive, negative, and zero). Each permutation combining possible specific events results in a different state.
Exhaustive verification of modem digital designs such as microprocessors is virtually impossible because such designs may attain an almost incalculable number of states. A designer must therefore determine a sub-list of states that represent the most interesting states. The sub-list of states should include functional events, which are events that can be defined based on the specification of the design, and implementation events, which are specific to how the designer chose to implement the specification. While the sub-list of interesting states is not exhaustive, it usually provides a yardstick for measuring test coverage. To gain an adequate level of confidence that the design is functioning correctly, it is necessary to verify whether the design attains all of these interesting states during operation or simulation.
Verification of digital designs is usually done using a simulator. A simulator is a program that runs the design file of a digital design in order to recreate how the design would perform on a computer chip. A common method for generating test stimulus is to use a random, or directed random, test case generator. With random test case generation, the correctness of the design being simulated is established by having the results predicted automatically by some sort of reference model. The actual checking may take many forms, ranging from comparing the final results in memory to checking internal state cycle-by-cycle. There are major advantages to using random test case generation. Computer programs can generate test cases much faster than people can, so many more design states can be reached in the same amount of time using random test case generation. This is critically important for complex designs which need a reasonable time-to-market. Also, by introducing randomness, the verification engineer can think of a general set of tests that would hit interesting states, and let the computer generate all the special cases. In many cases, the random test generator ends up creating situations that a tester may not have thought to create.
A drawback to random test case generation, however, is that it is difficult to know exactly what is being tested. Thus, it is difficult to gain an adequate level of confidence that the design is attaining all of the required states determined by the designer to be interesting. A number of approaches have been used to determine when a design has been sufficiently verified using random lit test case generation. One method is to use statistical data from previous designs to predict the expected bug rate. This requires that the statistical data exist for the same style of design and the same test generation tool. Another method is to simply try as many different test strategies with the random test generator as one can think of, and then run them until the bug rate decreases. A third method is to use coverage analysis tools to quantify what percentage of the existing design states have been hit.
Existing coverage analysis tools typically traverse the source code of the design to generate a list of unique states to be tracked. Since the resulting coverage data is based purely on the existing source code, the coverage data is very specific to the implementation of the design. There is no way to use the coverage data to evaluate functional coverage, or how much of the specification has been tested. It can also be difficult to evaluate how many of the cases that have not been hit are actually interesting. And finally, source-code generated coverage data can not include data on interesting combinations of events.
The present invention introduces a method for evaluating coverage from either a functional or an implementation perspective, including combinatorial coverage. It provides an easy way to write a software monitor to identify an event in a design and then log the information concerning attainment of the state into a database for further analysis. The analysis of the database will determine if adequate coverage is being performed on this list of events, and if not, the cause of the lack of coverage can be investigated. The list of events can be driven by the sub-list of events determined by the designer to be interesting.
The lists of interesting events in the test coverage of a design can, in some cases, be described by taking a cross product of some combination of events. For example, it is typically interesting to verify that the design has been tested where all combinations of two instructions have run back-to-back. Another example is to test all possible combinations of operands for an instruction. As designs are capable of executing more unique instructions with more types of operands, more interesting states can be expressed as a cross product of different events.
Supporting a new logic design style requires the invention of new coding techniques to verify the computer-aided design of the logic circuits and their constituent subcircuits. The N-nary logic design style is no exception. N-nary logic is a dynamic logic design style fully described in a copending patent application, U.S. patent application Ser. No. 09/019355, filed Feb. 5, 1998 (05.02.1998), now U.S. Pat. No. 6,066,965, and titled xe2x80x9cMethod and Apparatus for a N-Nary logic Circuit Using 1-of-4 Signalsxe2x80x9d, which is incorporated by reference for all purposes and is referred to as xe2x80x9cThe N-nary Patent.xe2x80x9d The simulation of N-nary logic is fully described in the following copending patent applications: U.S. patent application Ser. No. 09/405,618, filed Sep. 24, 1999(24.09.1999), titled xe2x80x9cSoftware Modeling of Logic Signals Capable of Holding More Than Two Valuesxe2x80x9d, and U.S. patent application Ser. No. 09/405,474, filed Sep. 24, 1999(24.09.1999), titled xe2x80x9cFour-State Simulation for Non-Binary Logicxe2x80x9d, both of which are incorporated by reference for all purposes.
The N-nary logic family supports a variety of signal encodings, including 1-of-4. In 1-of-4 encoding, four wires are used to indicate one of four possible values. In contrast, traditional static logic design uses two wires to indicate four values, as is demonstrated in Table 1. In Table 1, the A0 and A1 wires are used to indicate the four possible values for operand A: 00, 01, 10, and 11. Table 1 also shows the decimal value of an encoded 1-of-4 signal corresponding to the two-bit operand value, and the methodology by which the value is encoded using four wires.
xe2x80x9cTraditionalxe2x80x9d dual-rail dynamic logic also uses four wires to represent two bits, but the dual-rail scheme always requires two wires to be asserted. In contrast, as shown in Table 1, N-nary logic only requires assertion of one wire. The benefits of N-nary logic over dual-rail dynamic logic, such as reduced power and reduced noise, should be apparent from a reading of the N-nary Patent. All N-nary logic, including 1-of-4, are of the 1-of-N form where N is any integer greater than one. A 1-of-4 signal requires four wires to encode four values (0-3 inclusive), or the equivalent of two bits of information. More than one wire will never be asserted for a valid 1-of-N signal. Similarly, N-nary logic requires that a high voltage be asserted on only one wire for all values, even the value for zero (0).
Any one N-nary logic gate may comprise multiple inputs and/or outputs. In such a case, a variety of different N-nary encodings may be employed. For instance, consider a gate that comprises two inputs and two outputs, where the inputs are a 1-of-4 signal and a 1-of-2 signal and the outputs comprise a 1-of-4 signal and a 1-of-3 signal. Variables such as P, Q, R, and S may be used to describe the encoding for these inputs and outputs. One may say that one input comprises 1-of-P encoding and the other comprises 1-of-Q encoding, wherein P equals two and Q equals four. Similarly, the variables R and S may be used to describe the outputs. One might say that one output comprises 1-of-R encoding and the other output comprises 1-of-S encoding, wherein R equals four and S equals 3. Through the use of these, and other, additional variables, it is possible to describe multiple N-nary signals that comprise a variety of different encodings.
The signal naming convention used in the present disclosure is fully described in a patent application, U.S. patent application Ser. No. 09/210,408, filed Dec. 11, 1998 (11.12.1998), now U.S. Pat. No. 6,289,497, and titled xe2x80x9cMethod and Apparatus for N-nary Hardware Description Languagexe2x80x9d, which is incorporated by reference for all purposes and is referred to as xe2x80x9cThe Hardware Description Patent.xe2x80x9d
The signal naming convention identifies certain information that characterizes the signal, specifically information concerning 1-of-N degree, evaluation, and clock phase. The naming convention indicates the 1-of-N degree for each gate signal. The character, H, h, L, or l, in the evaluation field conveys information concerning the evaluation direction and evaluation completeness of the signal. The characters xe2x80x9cHxe2x80x9d and xe2x80x9chxe2x80x9d indicate evaluation on the rising edge, or high-going signals; the characters xe2x80x9cLxe2x80x9d and xe2x80x9clxe2x80x9d indicate evaluation on the falling edge, or low-going signals. This signal convention allows the transistor synthesis tool described in the Hardware Description Patent to ensure that only high-going signals are used for connections between gates. The transistor synthesis tool uses low-going signals internally within cells.
The use of the upper- and lower-case of H and L designate the xe2x80x9cevaluation completenessxe2x80x9d of the named signal. To understand xe2x80x9cevaluation completeness,xe2x80x9d a background discussion of N-nary signal characteristics may be helpful. A l-of-N signal is a signal driven by a cell that evaluates for all possible legal combinations of input. The 1-of-N signal will, if it fails to evaluate, represent an invalid state. A 0-or-1-of-N signal is a signal driven by a cell that fails to evaluate for some legal input value. The 0-or-1-of-N signal will, if it fails to evaluate, represent a null value. This stems from the fact that, even for a value of zero, a 1-of-N signal must assert a positive voltage on one, and only one, wire of the N potential wires. Failure of a 0-or-1-of-N signal to assert a wire during an evaluation clock phase therefore results in a null value, rather than a value of zero. In the preferred embodiment of N-nary C, 1-of-N signals are indicated by the upper-case characters H and L in the evaluation field; 0-or-1-of-N signals are indicated by the lower-case characters h and l in the evaluation field.
The value of the clock phase field delivers information regarding the clock phase during which evaluation of the cell driving the signal evaluates. The minimum valid value for phase is 0 and the maximum is Mxe2x88x921, where M is the highest number of clock phases available to the circuit under design. The number of valid clock phases is a design specific variable, but may typically be between 3 and 6.
N-nary C also allows certain other optional information to be included in the name of a signal, including a description of the signal and bit number information. In the preferred embodiment, the signal description is set forth in the descriptor field and may comprise any number of lower-case alphanumeric characters, including the underscore xe2x80x9c_xe2x80x9d character. The contents of the bit field specify the bit column to which the gate being constructed belongs. Generally, in a data flow design, all the gates that operate on a given bit of data (e.g., xe2x80x9cbit 4xe2x80x9d) are xe2x80x9cfloorplannedxe2x80x9d such that the gates line up in a column (a xe2x80x9cbit columnxe2x80x9d), facilitating orderly operation of the gates. The xe2x80x9cfloorplanxe2x80x9d thus contains columns of related gates.
The present invention comprises a method and apparatus for a monitor that detects and reports a status event to a database. A monitor checks a digital design such as a processor for specific verification events; if the monitor detects a specified event, it reports the information to a database. The monitor comprises a monitor declaration, zero or more signal declarations, zero or more bus declarations, and one or more logic expressions. A monitor declaration defines the name of the monitor. A logic expression, formulated using the declared signals and buses, is used to evaluate whether a specific verification event has occurred.
The present invention further comprises an apparatus and method that reports events to a database through a monitor where the signal of the signal declaration of the monitor is an N-Nary signal. In 1-of-N encoding, N wires are used to indicate one of N possible values. In addition, the present invention further comprises a parser to translate the code in the monitor source file into a code that uses a standard computer language. In one embodiment of the present invention, the parser translates the keywords of the monitor language into C++ routines (functions) that are executed by the simulator. Finally, the present invention further comprises a monitor where if the monitor detects the specific event for which it was looking, the monitor reports this information to a database.
Additionally, the present invention comprises a monitor language that describes events using a plurality of keywords. A keyword is a shorthand notation for one or more routines constructed in a standard programming language. A parser translates the monitor language into a standard programming language. The monitor language comprises groups of instructions, including a group of logic expressions, a group of declarations, e.g., bus and signal declarations, and a group comprising the functional language of the keywords.
Additionally, the present invention comprises a method and apparatus that reports multiple design verification events with a single monitor. A grid is a monitor that detects a cross product of multiple verification events and reports a single status event to a database. A grid comprises a monitor declaration, one or more axis declarations, zero or more signal declarations, zero or more bus declarations, one or more logic expressions, and a grid declaration. A monitor declaration defines the name of the monitor. An axis declaration defines the valid states for a functional attribute under test. If two or more axis declarations are declared, the multiple axes are used to produce a cross product of verification events. A logic expression, formulated using the declared signals and buses, is used to evaluate whether a specific verification event has occurred so that the grid can return a status event. A grid declaration-returns the status event. The present invention further comprises embodiments where a grid uses a cross-product of verification events that comprises a fully populated cross-product of verification events or a sparsely populated cross-product of verification events.